package com.slfx.uid.genrator.controller;

import com.xfvape.uid.UidGenerator;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


@RestController
public class UidController {


    @Resource(name = "cachedUidGenerator")
    private UidGenerator uidGenerator;

    /**
     * 返回id
     *
     * @return
     */
    @GetMapping("/uidGenerator")
    public String UidGenerator() {
        return String.valueOf(uidGenerator.getUID());
    }

    @GetMapping("/")
    public String index() {
        return "index";
    }
}
